//
//  CZStatus.swift
//  XLWB009
//
//  Created by apple on 3/27/16.
//  Copyright © 2016 apple. All rights reserved.
//

import UIKit

class CZStatus: NSObject {

    //微博创建时间
    var created_at:String?
    
    //微博ID
    var id:Int=0
    
    //微博信息内容
    var text:String?
    
    //微博来源
    var source:String?
    
    //转发数
    var reposts_count: Int = 0
    
    //评论数
    var comments_count: Int = 0

    //点赞数
    var attitudes_count: Int = 0
    
    //图片地址数组
    var pic_urls:[[String:AnyObject]]?
    
    //KVC不会自动转模型，需要自己转CZUser
    var user:CZUser?
    
    //KVC字典转模型
    init(dict:[String:AnyObject]) {
        super.init()
        
        //KVC赋值
        setValuesForKeysWithDictionary(dict)
    }
    
    //处理key在模型中没有对应的属性
    override func setValue(value: AnyObject?, forUndefinedKey key: String) {}
    
    //打印对象方法
       override var description:String{
        
        //根据数组中的元素，获取模型对应的值，并生成字典
        let parametes=["created_at","id","text","source","reposts_count","comments_count","attitudes_count","pic_urls"]
        
        return "\n\t微博模型:\(parametes)"
    }
    
}


